package icu.javacg.storage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import icu.javacg.storage.pojo.Entry;
import icu.javacg.storage.pojo.vo.ReturnResult;
import icu.javacg.storage.service.EntryService;
import icu.javacg.storage.mapper.EntryMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author sky
* @description 针对表【entry(进入事件表。)】的数据库操作Service实现
* @createDate 2023-04-25 08:42:39
*/
@Service
public class EntryServiceImpl extends ServiceImpl<EntryMapper, Entry>
    implements EntryService{

    @Resource
    EntryMapper entryMapper;

    @Override
    public ReturnResult<Entry> insertEntry(Entry entry) {
         boolean insert = entryMapper.insert(entry) >0;
         if (insert ){
             return new ReturnResult<>(3510,"添加成功"+insert);
         }
            return new ReturnResult<>(3010,"添加失败");
    }



    @Override
    public Page<Entry> pageList(int a, int b) {
        Page<Entry> page = new Page<>(a,b);
        Page<Entry> entryPage = entryMapper.selectPage(page, null);
        return entryPage;
    }
}




